package com.grain.security.app.social.impl;

import com.grain.security.core.social.SocialAuthenticationFilterPostProcessor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
import org.springframework.social.security.SocialAuthenticationFilter;
import org.springframework.stereotype.Component;

@Component
public class AppSocialAuthenticationFilterProcessor implements SocialAuthenticationFilterPostProcessor{

    @Autowired
    private AuthenticationSuccessHandler grainAuthenticationSuccessHandler;

    @Override
    public void process(SocialAuthenticationFilter filter) {
        filter.setAuthenticationSuccessHandler(grainAuthenticationSuccessHandler);
    }
}
